﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using Heroius.Extension;

namespace Ryder
{
    public class PortInfo: ObservableEntity
    {
        public PortInfo(SerialPort port)
        {
            core = port;
        }

        SerialPort core;

        public int BaudRate { get { return core.BaudRate; } set { core.BaudRate = value; RaisePropertyChangedEvent("BaudRate"); } }
        public int ReadTimeout { get { return core.ReadTimeout; } set { core.ReadTimeout = value; RaisePropertyChangedEvent("ReadTimeout"); } }
        public int WriteTimeout { get { return core.WriteTimeout; } set { core.WriteTimeout = value; RaisePropertyChangedEvent("WriteTimeout"); } }
        public int DataBits { get { return core.DataBits; } set { core.DataBits = value; RaisePropertyChangedEvent("DataBits"); } }
        public StopBits StopBits { get { return core.StopBits; } set { core.StopBits = value; RaisePropertyChangedEvent("StopBits"); } }
        public Parity Parity { get { return core.Parity; } set { core.Parity = value; RaisePropertyChangedEvent("Parity"); } }
    }
}
